<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Redis;

class RedisController extends Controller
{
    public function redis()
    {

        $redis = app('redis.connection');

        $redis->set('library', 'predis'); // 存储 key 为 library， 值为 predis 的记录；

        $val = $redis->get('library');

        echo $val;

        echo "<br>-------------------<br>";

        Redis::set('name', 'Taylor');

        $user = Redis::get('name');

        echo $user;
    }
}
